Skip to content

bugfix(KLEF): Fix delete backend url construction failing#116

Merged
isaacwallace123 merged 16 commits intomainfrom
fix/KLEF_fix_delete
Feb 23, 2026
Merged

bugfix(KLEF): Fix delete backend url construction failing#116
isaacwallace123 merged 16 commits intomainfrom
fix/KLEF_fix_delete

Conversation

@jeremy-misola
Copy link
Contributor

@jeremy-misola jeremy-misola commented Feb 22, 2026

🚀 Pull Request Overview

📌 Summary

  • AI Insights Engine: New module in observability-service that performs statistical analysis on 7-day Prometheus metrics and uses OpenAI (GPT-4o-mini) to generate natural language recommendations for right-sizing, scaling, and cost optimization.
  • Centralized Admin Panel: New frontend dashboard for managing users, platform roles, and viewing system-wide audit logs.
  • Admin Role Enforcement: Introduced @RequirePlatformAdmin AOP-based security in Java services and dedicated admin middleware in Go services.
  • Accessibility Suite: Implemented "Skip to main content" links, ARIA live regions for chat/notifications, and proper semantic labeling to meet WCAG 2.0 AA standards.
  • Resource Attribution: Added "Top Resource Consumers" dashboard to identify projects with high cluster impact.

🔗 Related Issues

Closes # (Internal Task: Platform-wide Admin & AI Observability)


🧪 Changes

✅ What’s Included

  • Observability Service (Go):
    • Statistical Analysis Engine (Averages, P95/P99, Standard Deviation for anomaly detection).
    • OpenAI integration for infrastructure recommendations.
    • Caching layer for resource-heavy analysis (5m TTL).
  • User Service (Go):
    • New PostgreSQL repositories for admin_audit_logs.
    • CRUD endpoints for user suspension and platform role management.
  • Project Management & Billing (Java):
    • Admin-only project listing and force-deletion capabilities.
    • Propagation of Authorization headers in cross-service billing usage requests.
  • Frontend (React/TS):
    • New Admin Page with Tabs: User Management, Audit Logs, and Cluster Insights.
    • ProjectAttributionPanel for visualizing "Cluster Share" per project.
    • Accessibility: Skip links, ARIA dialog roles for ChatWidget, and form labels.
  • Security:
    • Aspect-oriented security in Java to verify platform_admin role via user-service.

❌ What’s Not Included

  • Automatic execution of AI recommendations (Read-only insights for now).
  • Historical audit log migration (Logs start from this deployment).

🧪 Testing

🔍 How Was This Tested?

  • Backend Unit Tests: Updated BillingControllerTest and MetricsServiceTest. Added insights_handler_test.go.
  • Integration Testing: Verified OpenAI prompt delivery and JSON response parsing.
  • Manual UI Testing: Navigated the Admin Panel using keyboard-only navigation to verify "Skip Link" and focus management.
  • Security Testing: Attempted to access /api/v1/admin/* endpoints using a standard user JWT; verified 403 Forbidden responses.

🧪 Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • End-to-end scenarios tested manually

🧩 Breaking Changes

  • Yes
  • No

Impact: Methods annotated with @RequirePlatformAdmin now require the user to have the platform_admin role assigned in the user-service. Existing users with standard "user" tokens will no longer be able to access system-wide project lists or node metrics.


🔐 Security Considerations

  • This PR affects authentication or authorization
  • This PR touches secrets, tokens, or environment variables
  • This PR affects infrastructure or deployment pipeline

Explanation:

  • Added a new platform_admin role checked via a synchronous internal API call between services.
  • New environment variables: OPENAI_API_KEY (must be added to ACR/K8s secrets).

📝 Documentation

  • /docs
  • README.md
  • API reference (New /admin endpoints documented in INSIGHTS_ENGINE_PROMPT.md)
  • Architecture diagrams / C4 / DDD docs

🎨 UI/UX Considerations

  • Includes new components (InsightsPanel, AuditLogTable, UsersTable)
  • Changes styles or theme tokens (Accessibility styles in index.html)
  • Requires design approval
  • Responsive behavior tested

📦 Checklist Before Merge

  • Follows project coding style
  • PR title follows semantic format (feat: add AI insights and admin panel)
  • All CI checks passing
  • No debug logs or commented-out code
  • Dependencies reviewed
  • No sensitive information added (API Keys are env-driven)

👤 Contributor Notes

The Go CI workflow was temporarily commented out in this diff to facilitate rapid testing of the multi-service integration. This must be uncommented before merging to main.

@github-actions github-actions bot added chore Maintenance/devex bugfix Bug fix labels Feb 22, 2026
@jeremy-misola jeremy-misola changed the title Fix/klef fix delete bugfix(KLEF): Fix delete backend url construction failing Feb 22, 2026
@github-actions github-actions bot added feature New feature or enhancement tests Test changes labels Feb 22, 2026
@github-actions github-actions bot added the docs Documentation label Feb 23, 2026
@github-actions github-actions bot added the security Security fix/hardening label Feb 23, 2026
@isaacwallace123 isaacwallace123 merged commit e0e100f into main Feb 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix chore Maintenance/devex docs Documentation feature New feature or enhancement security Security fix/hardening tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants